#include <bits/stdc++.h>
using namespace std;

int a[100005];

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    int n, jsq = 1;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    if(n == 1) cout << 1 << endl, exit(0);
    sort (a + 1, a + n + 1);
    int k = n;
    for (int i = 2; i <= n; i++)
    {
        jsq++;
        if (a[i] > a[i - 1])
        {
            k--;
            jsq = 1;
        }
        else
        {
            if (i - jsq > n - k) k--;
        }
    }
    cout << k;
    return 0;
}